import { IconMoon, IconSun } from '@douyinfe/semi-icons';
import themeStyle from './index.less';

const ThemeCut = ({ switchMode }: any) => {
  const body = document.body;
  const themeMode = body.hasAttribute('theme-mode');
  return (
    <div className={themeStyle.theme_container}>
      {(() => {
        if (themeMode) {
          return (
            <IconSun onClick={switchMode} className={themeStyle.icon_style} />
          );
        } else {
          return (
            <IconMoon onClick={switchMode} className={themeStyle.icon_style} />
          );
        }
      })()}
    </div>
  );
};

export default ThemeCut;
